package com.sys.mapper;

import com.sys.entity.SysUser;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface SysUserMapper {
    /**
     * 统计用户数量
     * @return
     */
    int count();

    /**
     * 查询所有
     * @return
     */
    List<SysUser> selectAll();

    /**
     * 示例2
     * @param realName
     * @return
     */
    List<SysUser> getUsersByRealName(String realName);

    List<SysUser> getUserListByPojo(SysUser sysUser);

    List<SysUser> getUserListByMap(Map<String,Object> map);
    List<SysUser> getUserListByParams(@Param("realName") String realNmae,@Param("roleId") int roleId);
    int insert(SysUser sysUser);
    List<SysUser> getUserListWithRoleName(SysUser sysUser);

    List<SysUser> getUserListByRoleId(@Param("roleId") Integer roleId);
    List<SysUser> getUserAndAddressesByUserId(@Param("userId") Integer userId);
    int modify(SysUser user);
    int updatePwd(@Param("id")Integer id,@Param("password") String pwd);
    int delete(@Param("id") Integer id);
    List<SysUser> selectList(@Param("realName") String realName,@Param("roleId") Integer roleId);
    List<SysUser> selectListByChoose(@Param("realName")String realName, @Param("roleId") Integer roleId, @Param("account") String account, @Param("createdTime")Date createdTime);
    List<SysUser> getUserByRoleIdArray(Integer[] roleIds);
    List<SysUser> getUserByRoleIdList(List<Integer> roleId );
    List<SysUser> getUserByRoleIdMap(Map<String,Object> map);
    int update(SysUser user);

    List<SysUser> selectPageList(@Param("realName")String realName,
                                 @Param("roleId")Integer roleId,
                                 @Param("pageBegin")Integer pageBegin,
                                 @Param("pageSize")Integer pageSize);
    List<SysUser> selectListPage(@Param("startIndex")Integer startIndex,@Param("pageSize")Integer pageSize);
}
